public class Date {
    public int year;
    public int month;
    public int day;

    public Date(){
        System.out.println("这是不带参数的构造方法");
    }

    public Date(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }


    public void printDate() {
        System.out.println(year + "/" + month + "/" + day);
    }

    public static void main(String[] args) {
        Date d1 = new Date();
        d1.printDate();
    }

    public void setDate(Date this,int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public static void main1(String[] args) {
        Date d1 = new Date(1999,1,1);
        d1.setDate(1999,1,1);
        d1.printDate();

        Date d2 = new Date(2000,1,1);
        d2.setDate(2000,1,1);
        d2.printDate();

        Date d3 = new Date(2001,1,1);
        d3.setDate(2001,1,1);
        d3.printDate();
    }
}
